<script setup>
import {zhCn, en, zhHk} from "element-plus/es/locale/index";
import {provide, ref} from "vue";

import locale_en from "./assets/locales/en.json";
import locale_zh from "./assets/locales/zhCh";


const local_setting = ref({
  current: {label: "English", value: en, conf: locale_en},
  list: [
    {label: "English", value: en, conf: locale_en},
    {label: "简体中文", value: zhCn, conf: locale_zh},
    {label: "繁体中文", value: zhHk, conf: locale_zh}
  ],
  select: (row) => {
    local_setting.value.current = row
  }
})
provide("local_set", local_setting)

</script>

<template>
  <el-config-provider size="default" :locale="local_setting.current.value">
    <router-view v-slot="{ Component }">
      <transition name="slide-fade" mode="out-in">
        <KeepAlive :max="20">
          <component :is="Component"/>
        </KeepAlive>
      </transition>
    </router-view>
  </el-config-provider>
</template>

<style scoped></style>
